3.1087 \(\int \frac {1}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))} \, dx\)

Optimal. Leaf size=174 \[ \frac {x \left (c^3+3 i c^2 d-3 c d^2+3 i d^3\right )}{4 a^2 (c-i d) (c+i d)^3}-\frac {d^3 \log (c \cos (e+f x)+d \sin (e+f x))}{a^2 f (c-i d) (c+i d)^3}+\frac {-3 d+i c}{4 a^2 f (c+i d)^2 (1+i \tan (e+f x))}-\frac {1}{4 f (-d+i c) (a+i a \tan (e+f x))^2} \]

[Out]

1/4*(c^3+3*I*c^2*d-3*c*d^2+3*I*d^3)*x/a^2/(c-I*d)/(c+I*d)^3-d^3*ln(c*cos(f*x+e)+d*sin(f*x+e))/a^2/(c-I*d)/(c+I
*d)^3/f+1/4*(I*c-3*d)/a^2/(c+I*d)^2/f/(1+I*tan(f*x+e))-1/4/(I*c-d)/f/(a+I*a*tan(f*x+e))^2

________________________________________________________________________________________

Rubi [A]  time = 0.41, antiderivative size = 174, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3559, 3596, 3531, 3530} \[ \frac {x \left (3 i c^2 d+c^3-3 c d^2+3 i d^3\right )}{4 a^2 (c-i d) (c+i d)^3}-\frac {d^3 \log (c \cos (e+f x)+d \sin (e+f x))}{a^2 f (c-i d) (c+i d)^3}+\frac {-3 d+i c}{4 a^2 f (c+i d)^2 (1+i \tan (e+f x))}-\frac {1}{4 f (-d+i c) (a+i a \tan (e+f x))^2} \]

Antiderivative was successfully verified.

[In]

Int[1/((a + I*a*Tan[e + f*x])^2*(c + d*Tan[e + f*x])),x]

[Out]

((c^3 + (3*I)*c^2*d - 3*c*d^2 + (3*I)*d^3)*x)/(4*a^2*(c - I*d)*(c + I*d)^3) - (d^3*Log[c*Cos[e + f*x] + d*Sin[
e + f*x]])/(a^2*(c - I*d)*(c + I*d)^3*f) + (I*c - 3*d)/(4*a^2*(c + I*d)^2*f*(1 + I*Tan[e + f*x])) - 1/(4*(I*c
- d)*f*(a + I*a*Tan[e + f*x])^2)

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rule 3559

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim
p[(a*(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1))/(2*f*m*(b*c - a*d)), x] + Dist[1/(2*a*m*(b*c - a*d))
, Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[b*c*m - a*d*(2*m + n + 1) + b*d*(m + n + 1)*Tan
[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2
+ d^2, 0] && LtQ[m, 0] && (IntegerQ[m] || IntegersQ[2*m, 2*n])

Rule 3596

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[((a*A + b*B)*(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1))/(2
*f*m*(b*c - a*d)), x] + Dist[1/(2*a*m*(b*c - a*d)), Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Si
mp[A*(b*c*m - a*d*(2*m + n + 1)) + B*(a*c*m - b*d*(n + 1)) + d*(A*b - a*B)*(m + n + 1)*Tan[e + f*x], x], x], x
] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0] &&  !GtQ[n,
0]

Rubi steps

\begin {align*} \int \frac {1}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))} \, dx &=-\frac {1}{4 (i c-d) f (a+i a \tan (e+f x))^2}-\frac {\int \frac {-2 a (i c-2 d)-2 i a d \tan (e+f x)}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))} \, dx}{4 a^2 (i c-d)}\\ &=\frac {i c-3 d}{4 a^2 (c+i d)^2 f (1+i \tan (e+f x))}-\frac {1}{4 (i c-d) f (a+i a \tan (e+f x))^2}-\frac {\int \frac {-2 a^2 \left (c^2+3 i c d-4 d^2\right )-2 a^2 (c+3 i d) d \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{8 a^4 (c+i d)^2}\\ &=\frac {\left (c^3+3 i c^2 d-3 c d^2+3 i d^3\right ) x}{4 a^2 (c+i d)^2 \left (c^2+d^2\right )}+\frac {i c-3 d}{4 a^2 (c+i d)^2 f (1+i \tan (e+f x))}-\frac {1}{4 (i c-d) f (a+i a \tan (e+f x))^2}-\frac {d^3 \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{a^2 (c+i d)^2 \left (c^2+d^2\right )}\\ &=\frac {\left (c^3+3 i c^2 d-3 c d^2+3 i d^3\right ) x}{4 a^2 (c+i d)^2 \left (c^2+d^2\right )}-\frac {d^3 \log (c \cos (e+f x)+d \sin (e+f x))}{a^2 (c+i d)^2 \left (c^2+d^2\right ) f}+\frac {i c-3 d}{4 a^2 (c+i d)^2 f (1+i \tan (e+f x))}-\frac {1}{4 (i c-d) f (a+i a \tan (e+f x))^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 1.53, size = 372, normalized size = 2.14 \[ -\frac {\sec ^2(e+f x) \left (4 i c^3 f x \sin (2 (e+f x))+c^3 \sin (2 (e+f x))+4 i c^3+16 d^3 (\sin (2 (e+f x))-i \cos (2 (e+f x))) \tan ^{-1}\left (\frac {\left (d^2-c^2\right ) \sin (f x)-2 c d \cos (f x)}{\left (c^2-d^2\right ) \cos (f x)-2 c d \sin (f x)}\right )+i c^2 d \sin (2 (e+f x))-12 c^2 d f x \sin (2 (e+f x))-8 c^2 d+\cos (2 (e+f x)) \left (-8 d^3 \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )+(c+i d)^2 (4 c f x+i c+4 i d f x+d)\right )-8 i d^3 \sin (2 (e+f x)) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )+c d^2 \sin (2 (e+f x))-12 i c d^2 f x \sin (2 (e+f x))+4 i c d^2+i d^3 \sin (2 (e+f x))+4 d^3 f x \sin (2 (e+f x))-8 d^3\right )}{16 a^2 f (c-i d) (c+i d)^3 (\tan (e+f x)-i)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[1/((a + I*a*Tan[e + f*x])^2*(c + d*Tan[e + f*x])),x]

[Out]

-1/16*(Sec[e + f*x]^2*((4*I)*c^3 - 8*c^2*d + (4*I)*c*d^2 - 8*d^3 + Cos[2*(e + f*x)]*((c + I*d)^2*(I*c + d + 4*
c*f*x + (4*I)*d*f*x) - 8*d^3*Log[(c*Cos[e + f*x] + d*Sin[e + f*x])^2]) + c^3*Sin[2*(e + f*x)] + I*c^2*d*Sin[2*
(e + f*x)] + c*d^2*Sin[2*(e + f*x)] + I*d^3*Sin[2*(e + f*x)] + (4*I)*c^3*f*x*Sin[2*(e + f*x)] - 12*c^2*d*f*x*S
in[2*(e + f*x)] - (12*I)*c*d^2*f*x*Sin[2*(e + f*x)] + 4*d^3*f*x*Sin[2*(e + f*x)] - (8*I)*d^3*Log[(c*Cos[e + f*
x] + d*Sin[e + f*x])^2]*Sin[2*(e + f*x)] + 16*d^3*ArcTan[(-2*c*d*Cos[f*x] + (-c^2 + d^2)*Sin[f*x])/((c^2 - d^2
)*Cos[f*x] - 2*c*d*Sin[f*x])]*((-I)*Cos[2*(e + f*x)] + Sin[2*(e + f*x)])))/(a^2*(c - I*d)*(c + I*d)^3*f*(-I +
Tan[e + f*x])^2)

________________________________________________________________________________________

fricas [A]  time = 0.62, size = 185, normalized size = 1.06 \[ -\frac {{\left (16 \, d^{3} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (\frac {{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right ) - {\left (4 \, c^{3} + 12 i \, c^{2} d - 12 \, c d^{2} + 28 i \, d^{3}\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} - i \, c^{3} + c^{2} d - i \, c d^{2} + d^{3} + {\left (-4 i \, c^{3} + 8 \, c^{2} d - 4 i \, c d^{2} + 8 \, d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{{\left (16 \, a^{2} c^{4} + 32 i \, a^{2} c^{3} d + 32 i \, a^{2} c d^{3} - 16 \, a^{2} d^{4}\right )} f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e)),x, algorithm="fricas")

[Out]

-(16*d^3*e^(4*I*f*x + 4*I*e)*log(((I*c + d)*e^(2*I*f*x + 2*I*e) + I*c - d)/(I*c + d)) - (4*c^3 + 12*I*c^2*d -
12*c*d^2 + 28*I*d^3)*f*x*e^(4*I*f*x + 4*I*e) - I*c^3 + c^2*d - I*c*d^2 + d^3 + (-4*I*c^3 + 8*c^2*d - 4*I*c*d^2
 + 8*d^3)*e^(2*I*f*x + 2*I*e))*e^(-4*I*f*x - 4*I*e)/((16*a^2*c^4 + 32*I*a^2*c^3*d + 32*I*a^2*c*d^3 - 16*a^2*d^
4)*f)

________________________________________________________________________________________

giac [B]  time = 1.47, size = 296, normalized size = 1.70 \[ -\frac {2 \, {\left (\frac {d^{4} \log \left (-i \, d \tan \left (f x + e\right ) - i \, c\right )}{2 \, a^{2} c^{4} d + 4 i \, a^{2} c^{3} d^{2} + 4 i \, a^{2} c d^{4} - 2 \, a^{2} d^{5}} + \frac {{\left (c^{2} + 4 i \, c d - 7 \, d^{2}\right )} \log \left (i \, \tan \left (f x + e\right ) + 1\right )}{-16 i \, a^{2} c^{3} + 48 \, a^{2} c^{2} d + 48 i \, a^{2} c d^{2} - 16 \, a^{2} d^{3}} - \frac {\log \left (\tan \left (f x + e\right ) + i\right )}{-16 i \, a^{2} c - 16 \, a^{2} d} - \frac {3 \, c^{2} \tan \left (f x + e\right )^{2} + 12 i \, c d \tan \left (f x + e\right )^{2} - 21 \, d^{2} \tan \left (f x + e\right )^{2} - 10 i \, c^{2} \tan \left (f x + e\right ) + 40 \, c d \tan \left (f x + e\right ) + 54 i \, d^{2} \tan \left (f x + e\right ) - 11 \, c^{2} - 36 i \, c d + 37 \, d^{2}}{{\left (-32 i \, a^{2} c^{3} + 96 \, a^{2} c^{2} d + 96 i \, a^{2} c d^{2} - 32 \, a^{2} d^{3}\right )} {\left (\tan \left (f x + e\right ) - i\right )}^{2}}\right )}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e)),x, algorithm="giac")

[Out]

-2*(d^4*log(-I*d*tan(f*x + e) - I*c)/(2*a^2*c^4*d + 4*I*a^2*c^3*d^2 + 4*I*a^2*c*d^4 - 2*a^2*d^5) + (c^2 + 4*I*
c*d - 7*d^2)*log(I*tan(f*x + e) + 1)/(-16*I*a^2*c^3 + 48*a^2*c^2*d + 48*I*a^2*c*d^2 - 16*a^2*d^3) - log(tan(f*
x + e) + I)/(-16*I*a^2*c - 16*a^2*d) - (3*c^2*tan(f*x + e)^2 + 12*I*c*d*tan(f*x + e)^2 - 21*d^2*tan(f*x + e)^2
 - 10*I*c^2*tan(f*x + e) + 40*c*d*tan(f*x + e) + 54*I*d^2*tan(f*x + e) - 11*c^2 - 36*I*c*d + 37*d^2)/((-32*I*a
^2*c^3 + 96*a^2*c^2*d + 96*I*a^2*c*d^2 - 32*a^2*d^3)*(tan(f*x + e) - I)^2))/f

________________________________________________________________________________________

maple [B]  time = 0.34, size = 339, normalized size = 1.95 \[ -\frac {i \ln \left (\tan \left (f x +e \right )+i\right )}{f \,a^{2} \left (8 i d -8 c \right )}+\frac {d^{3} \ln \left (c +d \tan \left (f x +e \right )\right )}{f \,a^{2} \left (i d -c \right ) \left (i d +c \right )^{3}}+\frac {i c d}{f \,a^{2} \left (i d +c \right )^{3} \left (\tan \left (f x +e \right )-i\right )}+\frac {c^{2}}{4 f \,a^{2} \left (i d +c \right )^{3} \left (\tan \left (f x +e \right )-i\right )}-\frac {3 d^{2}}{4 f \,a^{2} \left (i d +c \right )^{3} \left (\tan \left (f x +e \right )-i\right )}-\frac {i c^{2}}{4 f \,a^{2} \left (i d +c \right )^{3} \left (\tan \left (f x +e \right )-i\right )^{2}}+\frac {i d^{2}}{4 f \,a^{2} \left (i d +c \right )^{3} \left (\tan \left (f x +e \right )-i\right )^{2}}+\frac {c d}{2 f \,a^{2} \left (i d +c \right )^{3} \left (\tan \left (f x +e \right )-i\right )^{2}}-\frac {i \ln \left (\tan \left (f x +e \right )-i\right ) c^{2}}{8 f \,a^{2} \left (i d +c \right )^{3}}+\frac {7 i \ln \left (\tan \left (f x +e \right )-i\right ) d^{2}}{8 f \,a^{2} \left (i d +c \right )^{3}}+\frac {\ln \left (\tan \left (f x +e \right )-i\right ) c d}{2 f \,a^{2} \left (i d +c \right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e)),x)

[Out]

-I/f/a^2/(8*I*d-8*c)*ln(tan(f*x+e)+I)+1/f/a^2*d^3/(I*d-c)/(c+I*d)^3*ln(c+d*tan(f*x+e))+I/f/a^2/(c+I*d)^3/(tan(
f*x+e)-I)*c*d+1/4/f/a^2/(c+I*d)^3/(tan(f*x+e)-I)*c^2-3/4/f/a^2/(c+I*d)^3/(tan(f*x+e)-I)*d^2-1/4*I/f/a^2/(c+I*d
)^3/(tan(f*x+e)-I)^2*c^2+1/4*I/f/a^2/(c+I*d)^3/(tan(f*x+e)-I)^2*d^2+1/2/f/a^2/(c+I*d)^3/(tan(f*x+e)-I)^2*c*d-1
/8*I/f/a^2/(c+I*d)^3*ln(tan(f*x+e)-I)*c^2+7/8*I/f/a^2/(c+I*d)^3*ln(tan(f*x+e)-I)*d^2+1/2/f/a^2/(c+I*d)^3*ln(ta
n(f*x+e)-I)*c*d

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

mupad [B]  time = 9.23, size = 1384, normalized size = 7.95 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/((a + a*tan(e + f*x)*1i)^2*(c + d*tan(e + f*x))),x)

[Out]

symsum(log(root(640*a^6*c^4*d^4*e^3 - a^6*c^5*d^3*e^3*256i + a^6*c^3*d^5*e^3*256i + 256*a^6*c^6*d^2*e^3 + 256*
a^6*c^2*d^6*e^3 - a^6*c^7*d*e^3*256i + a^6*c*d^7*e^3*256i - 64*a^6*d^8*e^3 - 64*a^6*c^8*e^3 + a^2*c*d^5*e*18i
- a^2*c^5*d*e*6i + a^2*c^3*d^3*e*12i + 15*a^2*c^4*d^2*e + 9*a^2*c^2*d^4*e + 57*a^2*d^6*e - a^2*c^6*e - c^2*d^3
 - c*d^4*4i + 7*d^5, e, k)*(root(640*a^6*c^4*d^4*e^3 - a^6*c^5*d^3*e^3*256i + a^6*c^3*d^5*e^3*256i + 256*a^6*c
^6*d^2*e^3 + 256*a^6*c^2*d^6*e^3 - a^6*c^7*d*e^3*256i + a^6*c*d^7*e^3*256i - 64*a^6*d^8*e^3 - 64*a^6*c^8*e^3 +
 a^2*c*d^5*e*18i - a^2*c^5*d*e*6i + a^2*c^3*d^3*e*12i + 15*a^2*c^4*d^2*e + 9*a^2*c^2*d^4*e + 57*a^2*d^6*e - a^
2*c^6*e - c^2*d^3 - c*d^4*4i + 7*d^5, e, k)*((a^2*d^6 + a^2*c*d^5*4i - 6*a^2*c^2*d^4 - a^2*c^3*d^3*4i + a^2*c^
4*d^2)*(128*a^4*c*d^5 + 128*a^4*c^5*d - a^4*c^2*d^4*512i - 768*a^4*c^3*d^3 + a^4*c^4*d^2*512i) - tan(e + f*x)*
(a^2*d^6 + a^2*c*d^5*4i - 6*a^2*c^2*d^4 - a^2*c^3*d^3*4i + a^2*c^4*d^2)*(32*a^4*c^6 - 96*a^4*d^6 + a^4*c*d^5*3
84i + a^4*c^5*d*128i + 608*a^4*c^2*d^4 - a^4*c^3*d^3*512i - 288*a^4*c^4*d^2)) + (a^2*d^6 + a^2*c*d^5*4i - 6*a^
2*c^2*d^4 - a^2*c^3*d^3*4i + a^2*c^4*d^2)*(4*a^2*c^5 + a^2*d^5*12i + 44*a^2*c*d^4 + a^2*c^4*d*20i - a^2*c^2*d^
3*64i - 48*a^2*c^3*d^2) + tan(e + f*x)*(48*a^2*d^5 - a^2*c*d^4*120i + 8*a^2*c^4*d - 104*a^2*c^2*d^3 + a^2*c^3*
d^2*40i)*(a^2*d^6 + a^2*c*d^5*4i - 6*a^2*c^2*d^4 - a^2*c^3*d^3*4i + a^2*c^4*d^2)) - (13*c*d^3 - c^3*d + d^4*12
i - c^2*d^2*6i)*(a^2*d^6 + a^2*c*d^5*4i - 6*a^2*c^2*d^4 - a^2*c^3*d^3*4i + a^2*c^4*d^2) + tan(e + f*x)*(c*d^3*
6i - 9*d^4 + c^2*d^2)*(a^2*d^6 + a^2*c*d^5*4i - 6*a^2*c^2*d^4 - a^2*c^3*d^3*4i + a^2*c^4*d^2))*root(640*a^6*c^
4*d^4*e^3 - a^6*c^5*d^3*e^3*256i + a^6*c^3*d^5*e^3*256i + 256*a^6*c^6*d^2*e^3 + 256*a^6*c^2*d^6*e^3 - a^6*c^7*
d*e^3*256i + a^6*c*d^7*e^3*256i - 64*a^6*d^8*e^3 - 64*a^6*c^8*e^3 + a^2*c*d^5*e*18i - a^2*c^5*d*e*6i + a^2*c^3
*d^3*e*12i + 15*a^2*c^4*d^2*e + 9*a^2*c^2*d^4*e + 57*a^2*d^6*e - a^2*c^6*e - c^2*d^3 - c*d^4*4i + 7*d^5, e, k)
, k, 1, 3)/f + (((c + d*2i)*1i)/(2*a^2*(c*d*2i + c^2 - d^2)) - (tan(e + f*x)*(c + d*3i))/(4*a^2*(c*d*2i + c^2
- d^2)))/(f*(tan(e + f*x)*2i - tan(e + f*x)^2 + 1))

________________________________________________________________________________________

sympy [A]  time = 12.53, size = 614, normalized size = 3.53 \[ \frac {x \left (- c^{2} - 4 i c d + 7 d^{2}\right )}{- 4 a^{2} c^{3} - 12 i a^{2} c^{2} d + 12 a^{2} c d^{2} + 4 i a^{2} d^{3}} + \begin {cases} \frac {\left (4 i a^{2} c^{2} f e^{2 i e} - 8 a^{2} c d f e^{2 i e} - 4 i a^{2} d^{2} f e^{2 i e}\right ) e^{- 4 i f x} + \left (16 i a^{2} c^{2} f e^{4 i e} - 48 a^{2} c d f e^{4 i e} - 32 i a^{2} d^{2} f e^{4 i e}\right ) e^{- 2 i f x}}{64 a^{4} c^{3} f^{2} e^{6 i e} + 192 i a^{4} c^{2} d f^{2} e^{6 i e} - 192 a^{4} c d^{2} f^{2} e^{6 i e} - 64 i a^{4} d^{3} f^{2} e^{6 i e}} & \text {for}\: 64 a^{4} c^{3} f^{2} e^{6 i e} + 192 i a^{4} c^{2} d f^{2} e^{6 i e} - 192 a^{4} c d^{2} f^{2} e^{6 i e} - 64 i a^{4} d^{3} f^{2} e^{6 i e} \neq 0 \\x \left (- \frac {i c^{2} - 4 c d - 7 i d^{2}}{4 i a^{2} c^{3} - 12 a^{2} c^{2} d - 12 i a^{2} c d^{2} + 4 a^{2} d^{3}} + \frac {- c^{2} e^{4 i e} - 2 c^{2} e^{2 i e} - c^{2} - 4 i c d e^{4 i e} - 6 i c d e^{2 i e} - 2 i c d + 7 d^{2} e^{4 i e} + 4 d^{2} e^{2 i e} + d^{2}}{- 4 a^{2} c^{3} e^{4 i e} - 12 i a^{2} c^{2} d e^{4 i e} + 12 a^{2} c d^{2} e^{4 i e} + 4 i a^{2} d^{3} e^{4 i e}}\right ) & \text {otherwise} \end {cases} - \frac {d^{3} \log {\left (\frac {- i c + d}{- i c e^{2 i e} - d e^{2 i e}} + e^{2 i f x} \right )}}{a^{2} f \left (c - i d\right ) \left (c + i d\right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+I*a*tan(f*x+e))**2/(c+d*tan(f*x+e)),x)

[Out]

x*(-c**2 - 4*I*c*d + 7*d**2)/(-4*a**2*c**3 - 12*I*a**2*c**2*d + 12*a**2*c*d**2 + 4*I*a**2*d**3) + Piecewise(((
(4*I*a**2*c**2*f*exp(2*I*e) - 8*a**2*c*d*f*exp(2*I*e) - 4*I*a**2*d**2*f*exp(2*I*e))*exp(-4*I*f*x) + (16*I*a**2
*c**2*f*exp(4*I*e) - 48*a**2*c*d*f*exp(4*I*e) - 32*I*a**2*d**2*f*exp(4*I*e))*exp(-2*I*f*x))/(64*a**4*c**3*f**2
*exp(6*I*e) + 192*I*a**4*c**2*d*f**2*exp(6*I*e) - 192*a**4*c*d**2*f**2*exp(6*I*e) - 64*I*a**4*d**3*f**2*exp(6*
I*e)), Ne(64*a**4*c**3*f**2*exp(6*I*e) + 192*I*a**4*c**2*d*f**2*exp(6*I*e) - 192*a**4*c*d**2*f**2*exp(6*I*e) -
 64*I*a**4*d**3*f**2*exp(6*I*e), 0)), (x*(-(I*c**2 - 4*c*d - 7*I*d**2)/(4*I*a**2*c**3 - 12*a**2*c**2*d - 12*I*
a**2*c*d**2 + 4*a**2*d**3) + (-c**2*exp(4*I*e) - 2*c**2*exp(2*I*e) - c**2 - 4*I*c*d*exp(4*I*e) - 6*I*c*d*exp(2
*I*e) - 2*I*c*d + 7*d**2*exp(4*I*e) + 4*d**2*exp(2*I*e) + d**2)/(-4*a**2*c**3*exp(4*I*e) - 12*I*a**2*c**2*d*ex
p(4*I*e) + 12*a**2*c*d**2*exp(4*I*e) + 4*I*a**2*d**3*exp(4*I*e))), True)) - d**3*log((-I*c + d)/(-I*c*exp(2*I*
e) - d*exp(2*I*e)) + exp(2*I*f*x))/(a**2*f*(c - I*d)*(c + I*d)**3)

________________________________________________________________________________________